<? Phpr_View::beginBlock("head") ?>
	<script type="text/javascript" src="modules/shop/resources/javascript/save_item.js"></script>
<? Phpr_View::endBlock() ?>

<? Phpr_View::beginBlock("view") ?>
	<ul class="breadcrumbs">
		<li><a href="<?= url('/shop/categories') ?>">Categories</a></li>
		<li><?= $this->app_page_title ?></li>
	</ul>

	<? if (!isset($fatalError)): ?>
		<? if ($form_model->updated_at): ?>
			<div class="scoreboardReport">
				<ul>
					<li class="last">
						<h3>Last update by</h3>
						<p><?= h($form_model->updated_user_name) ?></p>
						<p class="description">
							at: <?= $form_model->displayField('updated_at') ?>
						</p>
					</li>
				</ul>
				<div class="clear"></div>
			</div>
		<? endif ?>
		
	<? endif ?>
	
	<? if (!isset($fatalError)): ?>
		<div class="form600">
			<?= Phpr_Form::openTag(array('id'=>'form_element')) ?>
				<? $this->formRender() ?>

				<?= backend_ajax_button('<u>S</u>ave', 'edit_onSave', array(), "prepareFunction: function(){phprTriggerSave();}, extraFields: {redirect: 0}, loadIndicator: {show: false}, onSuccess: function(){}, onBeforePost: LightLoadingIndicator.show.pass('Saving...'), onComplete: LightLoadingIndicator.hide, update: 'multi'") ?>
				<?= backend_ajax_button('Save and Close', 'edit_onSave', array(), "prepareFunction: function(){phprTriggerSave();},  extraFields: {edit_close: 1}") ?>
				<?= backend_ajax_button('Cancel', 'edit_onCancel') ?>

				<?= backend_ajax_button('Delete', 'edit_onDelete', array('class'=>"right"), "confirm: 'Do you really want to delete this category AND ALL ITS SUBCATEGORIES?'") ?>
				<div class="clear"></div>
			</form>
		</div>
	<? else: ?>
		<?= flash() ?>
		<p><a href="<?= url('/shop/categories') ?>">Return to the category list</a></p>
	<? endif ?>
<? Phpr_View::endBlock() ?>